package com.hmall.client.Service.Impl;

import com.hmall.UserClient.UserService;
import com.hmall.annotation.RpcReference;
import com.hmall.client.Pojo.Cart;
import com.hmall.client.Service.CartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class CartServiceImpl implements CartService {

//    @RpcReference(version = "version1", group = "test1")
    UserService userService;

    @Override
    public String getCartInfo(String cartNumber) {

        String userInfo = userService.getUserInfo("admin");
        Cart cart = Cart.builder()
                .cartNumber("AE86")
                .userInfo("userInfo")
                .build();
        log.info("CartService拿到UserInfo:{}", cart);
        return cart.toString();
    }
}
